package com.donleo.student.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.donleo.common.relation.UserTeamRelation;
import com.donleo.student.mapper.UserTeamRelationMapper;
import com.donleo.student.service.UserTeamRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户小组关联表 服务实现类
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
@Service
public class UserTeamRelationServiceImpl extends ServiceImpl<UserTeamRelationMapper, UserTeamRelation> implements UserTeamRelationService {

    @Autowired
    private UserTeamRelationMapper userTeamRelationMapper;

    @Override
    public List<UserTeamRelation> findByTeamCode(String teamCode) {
        List<UserTeamRelation> list = new LambdaQueryChainWrapper<>(userTeamRelationMapper)
                .eq(UserTeamRelation::getTeamCode, teamCode)
                .list();
        return list;
    }
}
